package com.xf.lastmall.moudle.enums;

/**
 * Created by wangzhaoqian5 on 2018/6/6.
 */
public enum OrderCanRefund {
    CAN_REFUND(1,"可以退款"),
    CAN_NOT_REFUND(0,"不可以退款");

    private int value;

    private String text;

    OrderCanRefund(int value, String text) {
        this.value = value;
        this.text = text;
    }

    public int getValue() {
        return this.value;
    }

    public String getText() {
        return this.text;
    }

    public static OrderCanRefund fromValue(int value) {
        for (OrderCanRefund action : OrderCanRefund.values()) {
            if (action.getValue()==value) {
                return action;
            }
        }
        return null;
    }

    public static OrderCanRefund fromText(String text) {
        for (OrderCanRefund action : OrderCanRefund.values()) {
            if (action.getText().equals(text)) {
                return action;
            }
        }
        return null;
    }
}
